var MarkerManager = Class.create({
    initialize : function(map, onMarkerAdded) {
        this.map = map;
        this.onMarkerAdded = onMarkerAdded;
        this.markers = new Hash();
    },

    setAll : function(markers) {
        var self = this;
        var tmp = new Hash();
        markers.each(function(marker) {
            tmp.set(marker.id, marker);
        });
        self.markers.each(function(pair) {
            pair.value.setMap(null);
        });
        tmp.each(function(pair) {
            self.onMarkerAdded(pair.value);
            pair.value.setMap(self.map);
        });
        self.markers = tmp;
    }
});
